chrome.webRequest.onCompleted.addListener(
    function (details) {
      if (details.ip) {
        console.log('------------------------------')
        console.log(details.ip)
        console.log(details.url)
        // 向当前活动的标签页发送 IP 地址
        chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
          chrome.tabs.sendMessage(tabs[0].id, { ip: details.ip });
        });
      }
    },
    { urls: ["<all_urls>"] }
  );
  